<html>
<head>
    <meta name="layout" content="freshmade">
</head>

<body>

<div id="content-wrapper">
    <div class="center-wrapper">
        <div class="content">
            <div id="main">
                <div class="post">
                    <div class="post-title">
                        <h1>${company.name}</h1>
                        <g:render template="/template/messageBar"/>
                    </div>

                    <div class="post-button">
                        <g:render template="/template/editdelete"/>
                    </div>

                    <div class="post-date">
                        <g:render template="/template/createdBy2" model="[trace: company]"/>
                    </div>
                </div>

                <div id="myform">
                    <div class="field">
                        <div class="key2"><g:message code="company.website"/></div>

                        <div class="value">
                            <g:link url="${company.website}" target="_blank">${company.website}</g:link>
                        </div>

                        <div class="clear"></div>
                    </div>

                    <div class="field">
                        <div class="key2"><g:message code="company.comment"/></div>

                        <div class="value">
                            ${company.comment}
                        </div>

                        <div class="clear"></div>
                    </div>
                </div>

                <br/>

                <div class="post">
                    <div class="post-title"><h3><g:message code="employee.list"/></h3></div>

                    <div class="post-date">
                        <g:render template="/template/listBar2" model="[size: company.employees.size()]"/>
                        | <g:link controller="employee" action="create" id="${company.id}">Add Employee...</g:link>
                    </div>

                </div>
                <table class="data-table">
                    <tr>
                        <th><g:message code="employee.name"/></th>
                        <th><g:message code="employee.tel"/></th>
                        <th><g:message code="employee.email"/></th>
                        <th><g:message code="trace.createdBy"/></th>
                        <th><g:message code="trace.dateCreated"/></th>
                        <th><g:message code="trace.lastUpdatedBy"/></th>
                        <th><g:message code="trace.lastUpdated"/></th>
                    </tr>
                    <tbody>
                    <g:each in="${company.employees}" status="i" var="e">
                        <tr class="${(i % 2) == 0 ? 'even' : 'odd'}">
                            <td><g:link controller="employee" action="show" id="${e.id}">${e.name}</g:link></td>
                            <td>${e.tel}</td>
                            <td>${e.email}</td>
                            <td>${e.createdBy.name}</td>
                            <td><g:formatDate date="${e.dateCreated}"/></td>
                            <td>${e.lastUpdatedBy.name}</td>
                            <td><g:formatDate date="${e.lastUpdated}"/></td>
                        </tr>
                    </g:each>
                    </tbody>
                </table>
            </div>

            <div class="clearer">&nbsp;</div>
        </div>

    </div>
</div>

</body>
</html>